package net.zwj.web;

import net.zwj.service.SimpleService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/test")
public class TestController {

	private SimpleService simpleService;
	
	@Autowired
	public void setSimpleService(SimpleService simpleService) {
		this.simpleService = simpleService;
	}

	@RequestMapping("/oracle")
	public String updateOracle(Model model) {
		simpleService.updateOracle();
		return "/test/result";
	}
	@RequestMapping("/mysql")
	public String updateMysql(Model model) {
		simpleService.updateMysql();
		return "/test/result";
	}
	@RequestMapping("/update")
	public String updateBoth(Model model) {
		simpleService.updateBoth();
		return "/test/result";
	}
	
	@RequestMapping("/rollback")
	public String rollback(Model model) {
		simpleService.rollbackBoth();
		return "/test/result";
	}
}
